<?php
class Comment {
	/**
	 * Fields userName and publicationDate may be considered as local id.
	 */
	private $content;
	private $publicationDate;
	private $userName; // uses as userId
	private $articleId;
	private $id; // surrogat id
	public static function newInstance($content, $userName, $articleId) {
		$comment = new Comment ( $content, time (), $userName, $articleId );
		return $comment;
	}
	public function __construct($content, $publicationDate, $username, $articleId) {
		$this->userName = $username;
		$this->content = $content;
		$this->publicationDate = $publicationDate;
		$this->articleId = $articleId;
	}
	public function setContent($content) {
		$this->content = $content;
	}
	public function setId($id) {
		$this->id = $id;
	}
	public function getId() {
		return $this->id;
	}
	public function setArticleId($articleId) {
		$this->articleId = $articleId;
	}
	public function getArticleId() {
		return $this->articleId;
	}
	public function getContent() {
		return $this->content;
	}
	public function getUserName() {
		return $this->userName;
	}
	public function getPublicationDate() {
		return $this->publicationDate;
	}
}

?>